﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace Proyecta.Experto
{
    public partial class Index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                CargarDatos();
            }

        }

        protected void CargarDatos()
        {
            DataSet ds = null;
            Proyecta.Data.BO.UsuariosBO BOusuao = new Proyecta.Data.BO.UsuariosBO();
            Proyecta.Data.DAO.UsuariosDAO DAOusua = new Data.DAO.UsuariosDAO();
            BOusuao.idRol = 3;
            /*
            ds = DAOusua.MostrarporRol(BOusuao);
            GridView1.DataSource = ds;
            GridView1.DataBind();
            */
        }

        public void redireccionar()
        {
            Response.Redirect("Expertos");
        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            int id = (int)GridView1.SelectedValue;
            Response.Redirect("Experto.aspx?id=" + id.ToString());
        }

        /*protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
        {
            e.Cancel = true;
            GridView1.EditIndex = -1;
            GridView1.DataBind();
        }

        protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
        {
            GridView1.EditIndex = e.NewEditIndex;
            GridView1.DataBind();
        }

        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {

            Proyecta.Data.BO.UsuariosBO bo = new Data.BO.UsuariosBO();
            GridViewRow row = GridView1.Rows[e.RowIndex];
            bo.idUsuario = int.Parse(((TextBox)(row.Cells[1].Controls[0])).Text);
            GridView1.DataBind();
            Response.Redirect("Expertos.aspx?id=" + bo.idUsuario + "");
        }*/

        protected void btnNuevo_Click(object sender, EventArgs e)
        {
            Response.Redirect("Expertos.aspx");
        }
    }
}